package com.itheima.consumer.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConfig {

    @Bean
    public DirectExchange directExchange(){
        return ExchangeBuilder.directExchange("directExchange").build();
    }

    @Bean
    public Queue directQueue1(){
        return QueueBuilder.durable("direct.queue1").build();
    }

    @Bean
    public Binding bindingDirect(){
        return BindingBuilder.bind(directQueue1()).to(directExchange()).with("direct");
    }
}
